class BusquedaCentro < ActiveRecord::Base
  def editable?(current_user)
    if current_user == ejecutivo_id
      return true
    end
    
    parents = Ejecutivo.find(ejecutivo_id).parent_list
    
    can_edit = false
    parents.each do |parent|
      can_edit = current_user == parent.id
      
      break if can_edit
    end
    can_edit

  end
end
